package com.sunny.ihealth;

import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.sunny.ihealth.utils.NetworkUtils;

public class LoginActivity extends BaseActivity implements View.OnClickListener {

    private TextInputLayout textInputLayoutName, textInputLayoutPwd;
    private EditText etUsername, etPassword;
    private Button btnLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        initViews();
    }

    private void initViews() {
        setStatusBarColor();
        setToolbar("登陆");

        textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayout_login_username);
        textInputLayoutPwd = (TextInputLayout) findViewById(R.id.textInputLayout_login_password);
        etUsername = textInputLayoutName.getEditText();
        etPassword = textInputLayoutPwd.getEditText();
        btnLogin = (Button) findViewById(R.id.btn_login_login);

        btnLogin.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if (!NetworkUtils.isNetworkAvailable(LoginActivity.this, true)) {
            return;
        }
        login();
    }

    //登陆
    private void login() {

    }


}
